package com.hangxin.commons.util;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ListUtils {

	public static void removeDuplicateWithOrder(List<Map<String,Object>> list) {
		   Set<Map<String,Object>> set = new HashSet<Map<String,Object>>();
		   List<Map<String,Object>> newList = new ArrayList<Map<String,Object>>();
		   for (Iterator<Map<String,Object>> iter = list.iterator(); iter.hasNext();) {
			   Map<String,Object> element = iter.next();
		          if (set.add(element))
		             newList.add(element);
		       }
		      list.clear();
		      list.addAll(newList);		    
		}
}
